home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / share / pyshared / launchpadbugs / projectbase.py < prev    next >
Text File  |  2008-08-27  |  2KB  |  76 lines

  1. import lpconstants as lpc
  2. import utils
  3.  
  4. from lphelper import LateBindingProperty
  5.  
  6. class ProjectInfo(object):
  7.     def __init__( self, project_name, project_summary, project_url, project_reviewed, project_registrar, project_date ):
  8.         self.__project_name = project_name
  9.         self.__project_summary = project_summary
  10.         self.__project_url = project_url
  11.         self.__project_license_reviewed = project_reviewed
  12.         self.__project_registar = project_registrar
  13.         self.__project_date = project_date
  14.         
  15.     @property
  16.     def name( self ):
  17.         return self.__project_name
  18.     
  19.     @property
  20.     def summary( self ):
  21.         return self.__project_summary
  22.     
  23.     @property
  24.     def url( self ):
  25.         return self.__project_url
  26.     
  27.     @property
  28.     def registrar( self ):
  29.         return self.__project_registar
  30.  
  31.     @property 
  32.     def license_reviewed( self ):
  33.         return self.__project_license_reviewed
  34.  
  35.     @property
  36.     def registered( self ):
  37.         return self.__project_date
  38.     
  39.     def __repr__( self ):
  40.         return "<ProjectInfo %s>" %self.name
  41.     
  42.     def __str__( self ):
  43.         return "[Project '%s': %s]" %( self.name, self.registrar or "" )
  44.     
  45. class ProjectPackageInfo( object ):
  46.     def __init__( self, pkg_name, pkg_src_url ):
  47.         self.__pkg_name=pkg_name
  48.         self.__pkg_src_url=pkg_src_url
  49.     
  50.     @property
  51.     def package_name( self ):
  52.         return self.__pkg_name
  53.     
  54.     @property
  55.     def package_url( self ):
  56.         return self.__pkg_src_url
  57.     
  58.     def __repr__( self ):
  59.         return "<ProjectPackageInfo %s>" % self.package_name
  60.     
  61.     def __str__( self ):
  62.         return "[Package '%s': '%s']" % ( self.package_name, self.package_url or "" )
  63.     
  64.  
  65.  
  66. class LPProject( object ):
  67.     def __init__( self, url, connection ):
  68.         self.__url = utils.valid_lp_url( url, utils.PROJECT )
  69.         self._connection = connection
  70.         
  71. class LPProjectPackage( object ):
  72.     def __init__( self, url, connection ):
  73.         self.__url = utils.valid_lp_url( url, utils.PROJECT_PACKAGES )
  74.         self._connection = connection   
  75.         
  76.